package longrise.phone.com.bjjt_henan.compensate;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.longrise.android.FormParameter;
import com.longrise.android.FrameworkManager;
import com.longrise.android.LFView;

import longrise.phone.com.bjjt_henan.R;
import longrise.phone.com.bjjt_henan.bindinginformation.BindDriveCardView;

/**
 * 是否前往绑定界面，Created by Administrator on 2016/5/11.
 */
public class PromptFirstView extends LFView implements View.OnClickListener {
    private Context context = null;
    private View view = null;
    private LinearLayout ll_homepage_entercompensate;
    private Button bt_promptfirst1;
    private Button bt_promptfirst2;

    public PromptFirstView(Context c) {
        super(c);
        this.context = c;
    }

    @Override
    public void refreshByTime() {

    }

    @Override
    public FormParameter getFormParameter() {
        FormParameter fp = new FormParameter();
        fp.setShowtitle(false);
        return fp;
    }

    @Override
    public void refresh() {

    }

    @Override
    public View getView() {
        return view;
    }

    @Override
    public void init() {
        initView();
        regEvent(true);


    }

    private void initView() {
        view = View.inflate(context, R.layout.view_promptfirst, null);
        bt_promptfirst1 = (Button) view.findViewById(R.id.bt_promptfirst1);
        bt_promptfirst2 = (Button) view.findViewById(R.id.bt_promptfirst2);
    }

    private void regEvent(boolean b) {
        if (null != bt_promptfirst1) {
            bt_promptfirst1.setOnClickListener(b ? this : null);
        }
        if (null != bt_promptfirst2) {
            bt_promptfirst2.setOnClickListener(b ? this : null);
        }


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_promptfirst1:
                //进入绑定界面
                BindDriveCardView bindingdrivinglicenseview = new BindDriveCardView(context,null);
                FrameworkManager.getInstance().showNewForm(context, bindingdrivinglicenseview);
                break;
            case R.id.bt_promptfirst2:
                //回到主页
                closeForm();
                break;

        }
    }
}
